"""Urls for emencia.news"""
from django.conf.urls.defaults import *

from emg_intra.news.models import News
from views import news_by_language

news_conf = {'queryset': News.published.all()}
news_conf_last = {'queryset': News.published.all(),
                  'template_name': 'news/news_last.html',
                  'paginate_by': 1}

urlpatterns = patterns('django.views.generic.list_detail',
                       url(r'^last/$', 'object_list',
                           news_conf_last, 'news_news_last'),
                       url(r'^(?P<slug>[-\w]+)/$', 'object_detail',
                           news_conf, 'news_news_detail'),
                      )

urlpatterns += patterns('',
                        url(r'^$', news_by_language, name='news_news_list'),
                       )
